package com.atguigu.tingshu.user.client;

import com.atguigu.tingshu.model.user.UserInfo;
import com.atguigu.tingshu.model.user.VipServiceConfig;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.Map;

/**
 *  用户信息feign接口
 */
@FeignClient(name = "service-user", path = "/client/user/userInfo", contextId = "userInfoFeignClient")
public interface UserInfoFeignClient {

  /**
   * 查询VIP服务的详细信息
   * @param id
   * @return
   */
  @GetMapping("getUserVipService/{id}")
  VipServiceConfig getVipServiceConfig(@PathVariable(value = "id") Long id);

  /**
   * 查询用户的信息
   * @param userId
   * @return
   */
  @GetMapping(value = "/getUserInfo/{userId}")
  UserInfo getUserInfo(@PathVariable(value = "userId") Long userId);

  /**
   * 查询用户是否购买过专辑的记录
   * @param userId
   * @param albumId
   * @return
   */
  @GetMapping("/getUserPaidAlbum/{userId}/{albumId}")
  Boolean getUserPaidAlbum(@PathVariable("userId") Long userId, @PathVariable("albumId") Long albumId);

  /**
   * 查询用户购买过声音的记录
   * @param userId
   * @param albumId
   * @return
   */
  @GetMapping("/getUserPaidTrack/{userId}/{albumId}")
  Map<String, Object> getUserPaidTrack(@PathVariable("userId") Long userId, @PathVariable("albumId") Long albumId);
}